Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
manishnarang
Partner - Creator
Partner - Creator

Help in set analyses

HI All,

Help me achive this: 

LOAD * INLINE
[
desk, ord, hourr, rev
desk1,    order1, 2012-10-01-17.17.54.000000, 200
desk1,    order2, 2012-10-01-21.17.54.000000, 300
desk1,    order3, 2012-10-01-12.17.54.000000, 400
];

I need to show desk and sum of revenue in a straight table. Sum of revenue should be - where hour part in the timestamp is greater than 20 )

please help with a set analyses syntax. what i was trying to do here:
Hour(Timestamp#(hourr, 'YYYY-MM-DD-HH.mm.ss.ffffff'))


i created this formula to get hour part of it but i am not able to use in it set analyses syntax.

sum({$<$(=Hour(Timestamp#(hourr, 'YYYY-MM-DD-HH.mm.ss.ffffff')) = {">=20"})>}

it seems like it does not take expression on both the sides.

I know if i calculate it in the script, i can easily achieve this. but don't want to anything with teh script.. Thanks all

regards,

Manish

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Maybe this:

sum({$<hourr={"=hour(timestamp#(hourr,'YYYY-MM-DD-HH.mm.ss.ffffff'))>=20"}>} rev)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Maybe this:

sum({$<hourr={"=hour(timestamp#(hourr,'YYYY-MM-DD-HH.mm.ss.ffffff'))>=20"}>} rev)


talk is cheap, supply exceeds demand
Not applicable

desk1,    order1, 2012-10-01-17.17.54.000000, 200

you can get the hour part using mid()

=mid('2012-10-01-12.17.54.000000',15,2) or =mid('hourr',15,2)

will get you "17"

try

sum({<[mid('hourr',15,2)]={'20'}>}rev)