Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I'm new to Qlik sense and I have run into a problem with a dataset I'm using.
The dataset is about movies and I would like to convert the runtime to minutes. The runtime is currently formatted as '1 hr 30 min' but I would like it to be '90'.
some solutions might be:
tabRuntimes:
Load *,
Interval#(Replace(Replace(RuntimeTxt,'hr',':'),'min',''),'h : mm')*1440 as Runtime,
Evaluate(Replace(SubField(RuntimeTxt,'min',1),'hr','*60+')) as Runtime2
Inline [
RuntimeTxt
1 hr 30 min
1 hr 16 min
3 hr 21 min
];
hope this helps
Marco
Is this the only format or might there be others as well?
What if the runtime is shorter than one hour, or longer than a day for that matter?
This is the only format. The shortest runtime in the dataset is 1h 16 min and the longest in 3hr 21min.
some solutions might be:
tabRuntimes:
Load *,
Interval#(Replace(Replace(RuntimeTxt,'hr',':'),'min',''),'h : mm')*1440 as Runtime,
Evaluate(Replace(SubField(RuntimeTxt,'min',1),'hr','*60+')) as Runtime2
Inline [
RuntimeTxt
1 hr 30 min
1 hr 16 min
3 hr 21 min
];
hope this helps
Marco