Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Logic problem in table

Dear All,

I have this kind of data:-

ModelTypeMaterial CodeAmt
S55Raw112
S55Raw215
S55Raw347
S55SFG625
S55SFG2320
S55SFG4516
S55FG250123
S56Raw112
S56Raw1425
S56Raw1678
S56SFG2320
S56SFG5096
S56SFG6347
S56FG7815
S57Raw112
S57Raw215
S57Raw9996
S57SFG4516
S57SFG3025
S57SFG912
S57FG250

123

now my question is:-

my material ( 1)- occurs in all three model. So when i want to display the data in chart, i want amount for the material against model where it occurs first., and if the same material occur in other model then the amount should be zero.

For example;

Material code starting with 1 occurs in all three model i.e S55,S56,S57 and its amount is 12.So i want amount against S55 model because the material first occurred there and for the remaining model it should show zero value.

Please Help me out.....

5 Replies
jfkinspari
Partner - Specialist
Partner - Specialist

You can probably utilize the exists function like this


Load Model, Type, [Material Code],Amt, if(exists(Amt), 0, Amt) as ModifiedAmt

From...

and then use the field ModifiedAmt in your table. It should know only hold a a value above 0, for the first record with a unique Material Code.

Not applicable
Author

Hi,

You could reload your table in the script to set to 0 those values that are repeated in the same model:

NewTable:

Noconcatenate LOAD

     Model,

     Type,

     [Material Code],

     if(Previous([Material Code])=[Material Code], 0, Amt) as Amt

Resident YourTable

Order By [Material Code] asc;

Good Luck.

Not applicable
Author

How can i fit the above formula in front side

VishalWaghole
Specialist II
Specialist II

Hi,


PFA hope that will solve your problem.


Thanks,


Vishal

Not applicable
Author

@