# cols <- qShowCols("anal") ret <- runQry( "SELECT storeid , download_accounting_month , units , paidunits , freeunits , gest , gpuest , royaltydollar FROM aggregated_analytics WHERE storeid in (1, 18, 355, 36, 487, 286) AND download_accounting_month > '2014-03-01' " ) ret[, unitsr := royaltydollar * units] setkey(ret, storeid, download_accounting_month) ## any royaltydollar associated with freeunits ret[royaltydollar != 0 & freeunits != 0] ## any $0 royaltydollar for a store other than spotify ret[!.(286)][royaltydollar == 0 & paidunits != 0] ## any none-royaltydollar for a large gpuest? ret[royaltydollar == 0 & gpuest > .1] ret[.(286)] (GPU2) Revo> cols [1] "download_activity_date" "download_accounting_month" "units" [4] "paidunits" "freeunits" "royaltydollar" [7] "country_name" "country_code" "continent" [10] "continent_group" "continent_order" "storeid" [13] "store_name" "store_name_short" "store_group" [16] "store_group_less" "store_musicbucket" "store_videobucket" [19] "is_store_itunesusa" "releaseid" "release_name" [22] "release_releasedate" "release_sale_start_date" "release_sale_preorder_date" [25] "release_sale_physical_date" "release_theatrical_release_date" "release_vod_sale_start_date" [28] "release_priority" "release_version" "release_new_or_catalog" [31] "release_is_itunes_previewable" "release_is_compilation" "release_is_deleted" [34] "release_is_digital_only" "release_video_is_vod" "release_video_channel" [37] "release_product_type" "music_vs_video_by_product" "release_genre" [40] "release_genre_group" "release_genre_group_less" "labelid" [43] "label_name" "label_priority" "label_ownerid" [46] "label_owner" "label_is_distributor" "label_is_red" [49] "label_is_supplychain" "label_sc_group" "label_is_ioda" [52] "label_country" "label_continent" "artistid" [55] "artist_name" "artist_country" "transac_typeid" [58] "transac_type_abbr" "transac_type" "transac_type_group" [61] "music_vs_video_by_transac" "stream_vs_download" "album_vs_track" [64] "accounting_month_start" "accounting_month_end" "accounting_max_date_by_group" [67] "gest" "gpuest"