Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted
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

Highlighted
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