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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excluding records qty but not cost at script level

I have a set of claim numbers that are numeric only (ex. 123456) and another set that have letters in them (123456A). I would like to exclude the qty of claims that contain a letter on them but not the cost incurred for these claims. How can I do this at the script level without excluding the entire set of records?

3 Replies
pover
Partner - Master
Partner - Master

In the Qty field, put a conditional statement

if(isnum(Claim_Number),Qty,0) as Qty

Regards.

Not applicable
Author

Thank you for your response. Here is my scenario.

Claim number Qty Total Cost

000001 1 0.0355

000001A 1 198.35

000001B 1 12.89

000001C 1 35.7

000001D 1 79.54

Need this group to count as 1 claim since the alpha sets are subcategories of same claim.

But need total to include all costs - total $326.52

pover
Partner - Master
Partner - Master

The script would be something like this then:

Load [Claim number],
firstvalue(Qty) as Qty,
sum([Total Cost]) as [Total Cost]
Resident Table
Group by [Claim number]
Order by [Claim number];

Just test to make sure the main claim number is the first in the table so that firstvalue works or you can try firstsortedvalue() and sort by [Claim number].

Regards.