Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
buster22
Contributor II
Contributor II

Creating new field in a table based on if condition

Hi,

I have a question , i need to have it that there is only one date entry for each equipment there is lots of values for equipment so I cant do this. How could I write the if condition that would:

Check if there was multiple entries for the same piece of equipment on the same date in the date field

If true would sum their time and make a single equipment entry in a new table,

If false use this entry in the table

First table that if would operate on:

buster22_0-1588593723082.png

This is what the new table would look like:

buster22_2-1588594451962.png

Thanks for your time !

 

 

Labels (1)
1 Solution

Accepted Solutions
javiersassen
Partner
Partner

Hi,

In a case like this you can use the Group By statement in your load script.

your load statement would look like this:

LOAD Equipment, Date, SUM(time) as time from source Group By Equipment, Date;

 

View solution in original post

3 Replies
javiersassen
Partner
Partner

Hi,

In a case like this you can use the Group By statement in your load script.

your load statement would look like this:

LOAD Equipment, Date, SUM(time) as time from source Group By Equipment, Date;

 

shivanisapkale
Partner
Partner

Hi,

Instead of uisng If condition try to calculate it from back end,take the sum of Time field and use GRoup by function and add other dimension in group by except sum(time).

Regards,

Shivani Sapkale

Mauritz_SA
Partner
Partner

Hi @buster22 

I think if you make your time column a measure and use Sum(time) as the expression it should work. Otherwise, if you want to use it as a dimension you can probably use something like AGGR(Sum(time),Equipment,Date).

Hope this helps.

Regards,

Mauritz