hopkinsc wrote:Is there a way to exclude items in the script. I know how to include things by using the WHERE command, but have never tried excluding.
There are several ways of doing this. I usually use MATCH or EXISTS when you cannot do a SQL statement (so it seems the case) to get from the data source the values you want. The script would look like this
ReasonsToLoad:LOAD * INLINE [ReasonCodeWASTEREDUCTIONS]; Data:LOAD *FROM file.qvd(qvd)WHERE EXISTS(ReasonCode); // This field must be the same as the preivously loaded inline DROP TABLE ReasonsToLoad;
hopkinsc wrote:In the CSV example attached, you can see a reason: GOODS RECEIVED, RL1000,Store, 05:30. As this reason includes a time, there could be thousands of these lines. In DOS, i would use a command *.* to include all lines, (e.g. dir goods*.*), which would then list all lines starting with the word goods. Does QLIKVIEW have a function like this?
I understand that, once you have your data loaded, you want a way to select some values that are going to be displayed in one chart. If you liked to load all values, you would use "ReasonCode" as dimension. But since you only want to load some of the dimensions, creating a calculated dimension in your chart as
=If(Left(ReasonCode, 4) = 'Good', ReasonCode)
And check "Suppres null values" for that dimension, you will gett all possible values for ReasonCode which 4 first chars are "Good".
From this starting point to whatever you can imagine.
Hope that helps.
Hi, Sorry to bother you again Miguel...
Both suggestions seem to work, but all they seem to do is stop the reasoncode from displaying. The rest of the imformation appear. I want to be able to exclude the full line.
StoreNumber, Date, ProductCode, Reason, RSP etc.
with the calculated dimension you suggested, all other details are still visable which obviously means when i try and calculate total RSP for example, the calculation will include reasons that i don't want it to include.
I know i can write the calculation to ignore the reasons i don't want, but i don't really want the end user to see ANY details relating to anything other than waste and reductions.
Is there a way i can stop the full line being displayed relating to reasons that i'm not interested in.?
Many thanks for your help..
I have added a calculated dimension
=IF(Left(Narrative, 4) = 'Good' ,null(), Narrative)
which excludes anything starting with 'Good'. I can do this for all reasons that i do not want to see, but how do i add more than 1 in the same calculated dimension.
I have tried
=IF(Left(Narrative, 4) = 'Good' ,null(), Narrative) and IF(Left(Narrative, 4) = 'Stock' ,null(), Narrative)
but it doesn't seem to work.
I would probably need to add around 10 reasons in the same calculated dimension