Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excluding values from a listbox

HI There,

Hope you can help me with a query.

I have a field in a table called ForecastVersion, this contains data for CurrentForecast, 2013Forecast, 2012Forecast, Actuals and SellOut. I have a couple of Listboxes that allow a user to select two forecast versions to generate a compare in a line chart. I want the list boxes to exclude the Actuals and SellOut forecast versions. I used an expression like

=if(ForecastVersion<>'Actuals' and ForecastVersion<>'SellOut',ForecastVersion)

to exclude these. However when I do that i can't select the 'Always One Selected Value' checkbox under Properties-General. To resolve this, I want to create a new table in the script file that contains just the three ForecastVersions I need. How can I do this? How can I modify the code below to select only the fields I want?

Thanks

John

ForecastVersions:

Load

Data,

PurgeChar(ForecastVersion,' ') AS [ForecastVersion],

Measure,

Region,

PartName,

ShipDate,Date(Date# (ShipDate , 'YYYYMM'),'MMM-YY') as Date

2 Replies
iktrayanov
Creator III
Creator III

Load

Data,

if(PurgeChar(ForecastVersion,' ')<>'Actuals' and PurgeChar(ForecastVersion,' ')<>'SellOut',PurgeChar(ForecastVersion,' ')) AS [ForecastVersion],

Measure,

Region,

PartName,

ShipDate,Date(Date# (ShipDate , 'YYYYMM'),'MMM-YY') as Date

Not applicable
Author

Hi,

You could for example load a new resident table with all data from ForecastVersions, fields named differently, with condition Where Match([ForecastVersion],'Actuals','SellOut')=0.

However, f I were you, I'd just duplicate the first chart, to change the dimension ForecastVersion into a calculated one:

=if(Match([ForecastVersion],'Actuals','SellOut')=0, [ForecastVersion])

then name this dimension ForecastVersion and select not showing nulls. The 2nd graph displays the same data, just shows nothing for 'Actuals' and 'SellOut' selections.